﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.MODEL.FoundationModel;
using MINERP.DAL;

namespace MINERP.BLL.Common
{
    public class UserBLL
    {
            /// <summary>
            /// 得到所有的用户列表
            /// </summary>
            /// <returns></returns>
            public static List<User_Info> GetAllUsers()
            {
                List<User_Info> listU = new List<User_Info>();
                using (newSampleYPDBEntities db = new newSampleYPDBEntities())
                {
                    foreach (var u in db.users.Where(u=>u.IsUseful).ToList())
                    {
                        listU.Add(new User_Info()
                        {
                            UserID = u.userID,
                            UserName = u.UserName
                        });
                    }
                }
                return listU;
            }

            //public static List<InnerReturn_Info> GetInnerReturnResult(DateTime deStart, DateTime deEnd, List<string> listCreateUser, List<string> listResponseUser)
            //{
            //    List<InnerReturn_Info> listResult = new List<InnerReturn_Info>();
            //    using (newSampleYPDBEntities db = new newSampleYPDBEntities())
            //    {
            //        List<InnerReturn> list = db.InnerReturn.Where(i => i.CreateTime <= deEnd && i.CreateTime >= deStart).ToList();
            //        if (listCreateUser.Count > 0)
            //        {
            //            list = list.Where(i => listCreateUser.Contains(i.CreateMan)).ToList();
            //        }
            //        if (listResponseUser.Count > 0)
            //        {
            //            list = list.Where(i => listResponseUser.Contains(i.ResponMan)).ToList();
            //        }

            //        foreach (var i in list)
            //        {
            //            listResult.Add(new InnerReturn_Info()
            //            {
            //                Area = (float)i.PhotoAreas,
            //                CreateTime = i.CreateTime,
            //                CreateUserName = i.CreateMan,
            //                Height = (float)i.Heigth,
            //                Width = (float)i.Width,
            //                OrderProductId = i.OrderproductID,
            //                PhotoId
            //                = i.PhotoId,
            //                PicPath = i.PicPath,
            //                Remark = i.Remark,
            //                ResponseUserName = i.ResponMan
            //            });
            //        }
            //    }

            //    return listResult;
            //}
        
    }
}
